'''
Created on Dec 25, 2011

@author: 123kangta
'''
import unittest, re
from utils.importUtils import  import_module

test_cases = (
    "test.main.application_test.SocketManagerTest",
    "test.main.session_test.SessionTest",
    "test.main.ws_request_test.InitWebSocketRequestTest",
    "test.main.ws_request_test.InitWebSocketRequestTest",

    "test.main.filter.io_filter_test.FilterTest",
    "test.main.filter.messagefilter_test.SessionIdIncustomObjTest",

    "test.main.utils.json_test.ObjectToStrTest"
    )

def assembly_suite():
    loader = unittest.TestLoader()
    modules = []
    for name in test_cases:
        package, cls = re.search('(.+)\.(\w+)', name).groups()
        module = getattr(import_module(package), cls)
        modules.append(module)

    return unittest.TestSuite(map(loader.loadTestsFromTestCase, modules))


unittest.TextTestRunner(verbosity=2).run(assembly_suite())
